//
//  JobTableViewCell.m
//  Job
//
//  Created by 桑赐相 on 2018/8/14.
//  Copyright © 2018年 桑赐相. All rights reserved.
//

#import "JobTableViewCell.h"

@interface JobTableViewCell()

@property (weak, nonatomic) IBOutlet UILabel *jobTitle;
@property (weak, nonatomic) IBOutlet UILabel *methodLabel;
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
@property (weak, nonatomic) IBOutlet UILabel *locationLabel;
@property (weak, nonatomic) IBOutlet UIImageView *img1;
@property (weak, nonatomic) IBOutlet UILabel *currentQuotaLabel;
@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leftLayoutConstraint;

@property (nonatomic , strong) XLJobModel *model;

@end

@implementation JobTableViewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    [self.iconImage setLayerWithRadius:20 color:ClearColor width:0];
}



-(void)setModel:(XLJobModel *)model withHideIcon:(Boolean)hideIcon{
    _model = model;
    self.jobTitle.text = model.name;
    self.methodLabel.text = model.billingCycle;
    self.moneyLabel.text = model.salary;
    self.locationLabel.text = [NSString stringWithFormat:@"%@-%@",model.city,model.district];
    [self.img1 sd_setImageWithURL:[NSURL URLWithString:model.packageIcon]];
    self.iconImage.hidden = hideIcon;
    [self.iconImage sd_setImageWithURL:[NSURL URLWithString:model.logoURL] placeholderImage:[UIImage imageNamed:@"qita"] options:SDWebImageRetryFailed];
    if (hideIcon) {
        self.leftLayoutConstraint.constant = 12;
    }else{
        self.leftLayoutConstraint.constant = 60;
    }
    
}


@end
